<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminLogTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_log', function (Blueprint $table) {
            $table->increments('admin_log_id')->comment('主键');
            $table->string('player', 20)->comment('操作者');
            $table->integer('player_id')->nullable()->comment('操作者ID');
            $table->integer('type')->comment('操作类型0->登录 1->锁定 2->增 3->删 4->该 5->查');
            $table->string('target', 100)->comment('操作对象');
            $table->integer('target_id')->nullable()->comment('操作对象ID');
            $table->ipAddress('client_ip')->comment('客户端IP');
            $table->string('description')->nullable()->comment('描述');
            $table->string('url', 50)->nullable()->comment('地址');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_log');
    }
}
